package com.example.labyrinth;

import java.util.List;

public class cheesefinder {

	
			String findPathToCheese(List<List<Character>> labyrinth) {
				String path = "";

				int posX = 1;
				int posY = 1;

				char platz = labyrinth.get(posY).get(posX);
				char schrit = ' ';
				while (labyrinth.get(posY).get(posX) != 'C') { // runter

					char oben = labyrinth.get(posY - 1).get(posX);
					char unten = labyrinth.get(posY + 1).get(posX);
					char rechts = labyrinth.get(posY).get(posX + 1);
					char links = labyrinth.get(posY).get(posX - 1);

					 platz = labyrinth.get(posY).get(posX-1);
					 labyrinth.get(posY).set(posX, 'M');
					  	
				while (platz != 'C'){ 
					
					if (posY != labyrinth.lastIndexOf(null)){
					platz =labyrinth.get(posY+1).get(posX);
					}else {break;}
				
					System.out.println(platz);
					
				
				}
					 

					
					
		    
				

			}
return path;
			
		}

	
	
	
	
	
	
	}
		
	
	
	
	
